package mysql

import "gorm.io/gorm"

type DocToc struct {
	gorm.Model
	DocTocCode int64  `gorm:"type:int(11);not null;comment:'工号'"`
	Password   string `gorm:"type:varchar(255);not null;comment:'密码'"`
}

func (t *DocToc) FindOrCreate(db *gorm.DB, code int64) error {
	return db.Debug().Where("doc_toc_code=?", code).FirstOrCreate(t).Error
}

func (t *DocToc) FIndDocID(db *gorm.DB, id int64) error {
	return db.Debug().Where("id=?", id).First(t).Error
}
